<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/sys/role/";  //应用的地址名
String listActionName = basePath+"SysRoleUserMenu.action?op=searchjs";
String addActionName = basePath+"SysRole_add.action";
String editActionName = basePath+"SysRole_modify.action?chkSelf=";
String delActionName = basePath+"SysRole_del.action?op=deljs";
String relationUserActionName = basePath+"SysRole_relation.action";
String viewRelationUserActionName = basePath+"SysRole_viewRelationUser.action";
String menuId = "";
if(request.getParameter("menuId")!=null)
  menuId = request.getParameter("menuId");
%>
<script type="text/javascript">
    		$(function(){
			//表格初始化
			$('#searchTable').grid({
				title:<ce:menu title="角色菜单辅助管理"/>,
				url:'<%=listActionName%>',
				queryParams:{"search.userName":"","search.roleName":"","search.menuId":"0"},  //用于查询的参数以及初始值
				
				//数据列，根据显示的内容进行修改
				columns:[[   
						{field:'roleName',title:'角色名称',width:120,sortable:true,formatter:function(value,row,index){
						    if(row.roleId == "admin" || row.roleId == "common")  //当为系统内置的管理员和通用角色时，文字颜色设置为红色
						         return '<a href="javascript:openModifyPages(\''+row.roleId+'\')"><font color="red">'+value+'</font></a>';
						     else    
						         return  '<a href="javascript:openModifyPages(\''+row.roleId+'\')">'+value+'</a>';      
						}},
						{field:'userName',title:'用户名称',width:200},
						{field:'vcOperation',title:'权限编码',width:400}
				]]
			});
			//查询操作
			$('#search').click(function(){
		            defaultSearchAction();
            });		
		});	
		//点击编辑按钮后的操作：打开编辑界面
		function openModifyPages(roleId){
           defaultOpenAddPageHavebtn('<%=editActionName%>'+roleId,600,440,'角色权限修改');
		}
    
    </script>
<html>
  <head>
    <base href="<%=basePath%>"></base>
    <title><%=com.ce.util.RegeditUtil.getRegeditStringValue("SYSTEM_SEG_NAME") %></title>
  </head> 
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr height="30">
    <td>
    <div id="searchDiv" class="searchDiv">
     <div id="searchLeft" style=" width:85%; float:left">
       <div id="searchWrite"  class="searchWrite">
        角色名称：<input type="text" id="roleName" name="roleName">用户名称：<input type="text" id="userName" name="userName">
       </div>       
     </div>
     <div id="searchRight" class="searchRight">
      <a id="search" href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-search">查询</a>
     </div>
   </div></td>
  </tr>
  <tr>
    <td colspan="2"><div id="searchTable"></div></td>
  </tr>
</table>
</body>
</html>
   
   

